/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gov.nist.ssd.swqb.core.files;

import gov.nist.ssd.swqb.core.ConfigFileManager;
import java.io.FileWriter;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Benjamin Herbomez
 */
public abstract class FileManager {

    protected String fileLocation = null;
    protected ConfigFileManager fm;
    protected String fileName;

    public FileManager(ConfigFileManager fm){
        this.fm = fm;
    }
    
    public abstract void save();
    public void saveIntern(String txt) {
        if (this.fileLocation != null) {
            FileWriter out = null;
            try {
                out = new FileWriter(fileLocation);
                out.write(txt);
            } catch (IOException ex) {
                Logger.getLogger(PrefixManager.class.getName()).log(Level.SEVERE, null, ex);
            } finally {
                try {

                    out.close();
                } catch (IOException ex) {
                    Logger.getLogger(PrefixManager.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
    }
}
